<?php

require_once 'common/conn.php';
if (isset($_GET['age'])) {
    $age = $_GET['age'];
}
if (isset($_GET['month'])) {
    $month = $_GET['month'];
}
if (isset($_GET['year'])) {
    $year = $_GET['year'];
}

$data = array();
if (isset($age) && isset($month)) {
    $db = new DBC();
    $sql = "SELECT packid,name,soundURL,imageURL,ImageAid1URL,ImageAid2URL,year,month,age  FROM t_pack WHERE year = '" . $year . "' AND month = '" . $month . "' AND age = " . $age;
    $data = $db->fetchData($sql);
}
$result = array();
$result['packs'] = $data;
echo json_encode($result);
?>